package com.controler;
import org.apache.commons.fileupload.FileUpload;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpSession;
@Controller
public class LoginController {
    @RequestMapping("login")
  public String login(HttpSession session, String username, String password, Model model){
        //把用户信息存在session中
        session.setAttribute("username",username);
        session.setAttribute("password",password);
        model.addAttribute("username",username);
        return "FileUpload";
  }
  @RequestMapping("turnLogin")
  public String goLogin()
  {
      return "index";
  }
  @RequestMapping("turnFileUpload")
  public String gomain()
  {
      return "FileUpload";
  }
  @RequestMapping("goout")
  public String goout(HttpSession session)
  {
      session.removeAttribute("username");
      session.removeAttribute("password");
      return "index";
  }
}
